Skip to main content
Version: 25.09

Policy Elements Reference


id: Content_Identifier_Policy_Element_Reference slug: Policy Element Reference title: Policy Element Reference tags: [admin, guide] description: Policy Element Reference sidebar_label: Policy Element

Policy Elements Reference

This reference guide provides detailed information about the building blocks used to create Content Identification policies and rules. Understanding these elements is essential for creating effective custom policies that accurately identify and classify content.

Overview

Content Identification policies are built using XML-based policy elements that define conditions, actions, and evaluation criteria. These elements work together to create sophisticated content matching rules that can identify sensitive data across various formats and contexts.

Core Policy Structure

Policy Hierarchy

Content Identification policies follow a hierarchical structure:

Policy
├── Rules
│ ├── Conditions
│ │ ├── Policy Elements
│ │ └── Evaluation Context
│ └── Actions
└── Resources

Policy Elements

Policy elements are the fundamental building blocks that define what content to match and how to evaluate it. Each element has specific attributes that control its behavior.

Common Element Attributes

All policy elements share these common attributes:

AttributeTypeDescriptionRequiredDefault
idStringUnique identifier for the element within the policyYes-
elementRefStringReference to XML element name in evaluation contextYes-

Number Policy Elements

Number elements evaluate numeric values within content or metadata.

AttributeTypeDescriptionRequiredConstraintsExample
idStringUnique element identifierYesMust be unique within policy"Size_Under_100"
elementRefStringXML element name to evaluateYesValid XML element name"DocumentSize"
minIntegerMinimum value for rangeNo*>= 0, <= max if specified0
maxIntegerMaximum value for rangeNo*>= min if specified100

*At least one of min or max must be specified.

Example:

<Number id="Size_Under_100" elementRef="DocumentSize" max="100" />
<Number id="Size_Over_100" elementRef="DocumentSize" min="100" />

Time Policy Elements

Time elements evaluate temporal data using ISO 8601 format.

AttributeTypeDescriptionRequiredFormatExample
idStringUnique element identifierYes-"Last_Modified"
elementRefStringXML element name to evaluateYesValid XML element name"LastModified"
minISO 8601 TimeMinimum time for rangeNo*HH:MM:SS+TZ"14:20:00+02:00"
maxISO 8601 TimeMaximum time for rangeNo*HH:MM:SS+TZ"15:00:00+02:00"

*At least one of min or max must be specified.

Supported Time Formats:

  • HH:MM:SS (24-hour format)
  • HH:MM:SS+TZ (with timezone offset)
  • HH:MM:SS.sss (with milliseconds)

Example:

<Time elementRef="Last_Modified" min="14:20:00+02:00" max="15:00:00+02:00" />

String Policy Elements

String elements evaluate text content using various matching criteria.

AttributeTypeDescriptionRequiredOptionsExample
idStringUnique element identifierYes-"FileName_Pattern"
elementRefStringXML element name to evaluateYesValid XML element name"FileName"
valueStringString value to matchYesAny string"confidential"
caseSensitiveBooleanCase-sensitive matchingNotrue, falsefalse
matchTypeStringType of string matchingNoexact, contains, regex, wildcardcontains

Match Types:

  • exact: Exact string match
  • contains: Substring match
  • regex: Regular expression pattern
  • wildcard: Wildcard pattern (* and ?)

Example:

<String id="FileName_Pattern" elementRef="FileName" value="*confidential*" matchType="wildcard" caseSensitive="false" />

Boolean Policy Elements

Boolean elements evaluate true/false conditions.

AttributeTypeDescriptionRequiredValuesExample
idStringUnique element identifierYes-"IsEncrypted"
elementRefStringXML element name to evaluateYesValid XML element name"Encrypted"
valueBooleanBoolean value to matchYestrue, falsetrue

Example:

<Boolean id="IsEncrypted" elementRef="Encrypted" value="true" />

Evaluation Context

The evaluation context provides the data that policy elements can reference. It contains metadata and content information extracted from the analyzed content.

Common Context Elements

Element NameTypeDescriptionExample Value
DocumentSizeNumberFile size in bytes1048576
FileNameStringName of the file"report.docx"
FileExtensionStringFile extension".docx"
LastModifiedTimeLast modification time"14:45:03.520+02:00"
CreatedTimeCreation time"09:30:15.000+02:00"
EncryptedBooleanWhether content is encryptedfalse
ContentTypeStringMIME type of content"application/pdf"

Content-Specific Elements

Different content types provide additional context elements:

Document Files:

  • PageCount (Number)
  • WordCount (Number)
  • Author (String)
  • Title (String)

Image Files:

  • Width (Number)
  • Height (Number)
  • ColorDepth (Number)
  • Format (String)

Email Messages:

  • Subject (String)
  • Sender (String)
  • Recipients (String)
  • AttachmentCount (Number)

Rule Conditions

Conditions combine policy elements using logical operators to create complex matching criteria.

Logical Operators

OperatorDescriptionExample
ANDAll conditions must be true<AND><Element1/><Element2/></AND>
ORAt least one condition must be true<OR><Element1/><Element2/></OR>
NOTCondition must be false<NOT><Element1/></NOT>

Condition Structure

<Condition>
<AND>
<Number id="LargeFile" elementRef="DocumentSize" min="1000000" />
<String id="SensitiveContent" elementRef="FileName" value="confidential" matchType="contains" />
</AND>
</Condition>

Identifying Elements in Results

When multiple conditions can match the same policy element, you can use the id attribute to identify which specific condition matched in the results.

Best Practices

Element Design

  1. Use Descriptive IDs: Choose meaningful identifiers that clearly describe the element's purpose

    <!-- Good -->
    <Number id="LargeDocument_Over10MB" elementRef="DocumentSize" min="10485760" />

    <!-- Avoid -->
    <Number id="num1" elementRef="DocumentSize" min="10485760" />
  2. Optimize Range Conditions: Use appropriate min/max values to avoid unnecessary processing

    <!-- Efficient for file size checks -->
    <Number id="ReasonableFileSize" elementRef="DocumentSize" min="1024" max="104857600" />
  3. Case-Insensitive String Matching: Use case-insensitive matching for better coverage

    <String id="SensitiveKeyword" elementRef="Content" value="confidential" caseSensitive="false" />

Performance Considerations

  1. Limit Complex Regex: Use simple patterns when possible to improve performance
  2. Order Conditions: Place most selective conditions first in AND operations
  3. Use Appropriate Match Types: Choose the most efficient match type for your use case

Error Handling

  1. Validate Element References: Ensure elementRef values correspond to available context elements
  2. Check Range Constraints: Verify that min/max values are logically consistent
  3. Test Time Formats: Validate ISO 8601 time format compliance